var t,
  e = require("@/services/list"),
  i = require("../../../../utils/jump"),
  s =
    (t = require("../../../../config/page")) && t.__esModule
      ? t
      : { default: t };
Component({
  properties: {
    unEarthedIndex: {
      type: Number,
      value: 0,
      observer: function (t) {
        var e = this;
        this.setData({ productList: [] }, function () {
          var i = t;
          i = t <= 1 ? 6 + t : t - 2;
          var s = e.data.list;
          e.setData({ swiperCurrent: i, productList: s[t].items });
        });
      },
    },
  },
  data: { swiperCurrent: 6, list: [], productList: [], showMoreDesc: !1 },
  attached: function () {
    var t = this.getList();
    this.setData({ list: t, productList: t[this.data.unEarthedIndex].items });
  },
  methods: {
    getList: function () {
      var t = (0, e.getUnearthedList)(),
        i = [
          "https://industry.map.qq.com/cloud/file/2023/07/13/1689245426483_5yidX9GS.jpg",
          "https://industry.map.qq.com/cloud/file/2023/07/13/1689245431003_tRDTEiXf.jpg",
          "https://industry.map.qq.com/cloud/file/2023/07/13/1689245435646_6pnDDa5j.jpg",
          "https://industry.map.qq.com/cloud/file/2023/07/13/1689245440454_JizdK9NF.jpg",
          "https://industry.map.qq.com/cloud/file/2023/07/13/1689245450921_43AR5Tph.jpg",
          "https://industry.map.qq.com/cloud/file/2023/07/13/1689245455427_GSfT8h9w.jpg",
          "https://industry.map.qq.com/cloud/file/2023/07/13/1689245460663_dyACfkT9.jpg",
          "https://industry.map.qq.com/cloud/file/2023/07/13/1689245465763_fRF6Js8s.jpg",
        ];
      return t.map(function (t, e) {
        return {
          bg: i[e],
          title: t.title,
          desc:
            t.instance.properties.description.length > 90
              ? "".concat(
                  t.instance.properties.description.substr(0, 70),
                  '... <mark style="color:#A5864D;background:rgba(0,0,0,0);">详情></mark>',
                )
              : "",
          items: t.originalPic
            .map(function (t, e) {
              var i = {
                fileThumbnail:
                  -1 !== t.fileThumbnail.indexOf("https")
                    ? t.fileThumbnail
                    : "https://pckgs.sxd.cn/9999/" + t.fileThumbnail,
                materialTitle: t.materialTitle.split("（")[0],
                id: t.id,
                style: "position: absolute;left: 12%;top: 50%;",
              };
              return (
                1 === e
                  ? (i.style = "position: absolute;left: 38%;top: 40%;")
                  : 2 === e &&
                    (i.style = "position: absolute;left: 68%;top: 42%;"),
                i
              );
            })
            .slice(0, 3),
        };
      });
    },
    handleTapCircle: function (t) {
      var e = t.currentTarget.dataset.index;
      this.triggerEvent("onChoice", { activeIndex: e });
    },
    showCard: function () {
      this.triggerEvent("onShowUnearthCard", {
        activeIndex: this.data.unEarthedIndex,
      });
    },
    goCulturalCard: function (t) {
      var e = t.currentTarget.dataset.id;
      (0, i.navigateTo)(s.default.PAGE_APPRECIATION_COLLECTION_CARD_INDEX, {
        id: e,
      });
    },
    showMore: function () {
      this.triggerEvent("onShowUnearthMore", {
        activeIndex: this.data.unEarthedIndex,
      });
    },
    closeCard: function () {
      this.setData({ showMoreDesc: !1 });
    },
  },
});
